<template>
    <ul class="goods-list-top" v-if="priceList.length">
        <li v-for="item in priceList" :key="item.id">
            <RouterLink to="/">
            <img v-ilazy="item.picture" alt="" />
            <p class="name">{{ item.title? item.title:item.name}}</p>
            <p v-if="item.alt" class="desc">{{ item.alt }}</p>
            <p v-if="item.price" class="price">&yen;{{ item.price }}</p>
            </RouterLink>
        </li>
    </ul>
    <ul class="goods-list-top" v-else>
        <li v-for="i in 4" :key="i">
            <p>
                <XtxSkeleton width="306" height="306"  bg="#eee"/>
            </p>
             <p>
                <XtxSkeleton width="306" height="65"  bg="#eee"/>
            </p>
        </li>
    </ul>
</template>

<script>
export default {
  name: 'HomePrice',
  props: {
    priceList: {
      type: Array,
      default: () => []
    }
  }

}
</script>

<style scoped lang="less">
.goods-list-top {
  display: flex;
  justify-content: space-between;
  height: 406px;
  li {
    width: 306px;
    height: 406px;
    background: #f0f9f4;
    // 激活效果
    transition: all 0.5s;
    &:hover {
      transform: translate3d(0, -6px, 0);
      box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2);
    }
    // end
    img {
      width: 306px;
      height: 306px;
    }
    p {
      font-size: 22px;
      padding-top: 12px;
      text-align: center;
      text-overflow: ellipsis;
      overflow: hidden;
      white-space: nowrap;
    }
    .price {
      color: @priceColor;
    }
     .desc {
      color: #999;
      font-size: 18px;
    }
  }
}
</style>
